import request from '@/utils/request'

const api_name = '/teacher'

export default {
  getById(id) {
    return request({
      url: `${api_name}/getById?id=${id}`,
      method: 'get'
    })
  },
  //教师信息列表
  selectPage(current, limit, teacher) {
    return request({
      url: `${api_name}/selectPage?current=${current}&limit=${limit}`,
      method: 'post',
      data: teacher  //使用json
    })
  },
  selectCount() {
    return request({
      url: `${api_name}/selectCount`,
      method: 'get'
    })
  },
  selectOrderByTpt() {
    return request({
      url: `${api_name}/selectOrderByTpt`,
      method: 'get'
    })
  },
  //添加教师
  insert(teacher) {
    return request({
      url: `${api_name}/insert`,
      method: 'post',
      data: teacher
    })
  },
  //修改教师设置
  updateById(teacher) {
    return request({
      url: `${api_name}/updateById`,
      method: 'post',
      data: teacher
    })
  },
  //批量删除
  removeByIds(idList) {
    return request({
      url: `${api_name}/removeByIds`,
      method: 'delete',
      data: idList
    })
  }
}
